#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "plotviewcontrol.h"
#include <QDebug>

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::onDataUpdate(QwtPlotCurve *curve)
{
    qDebug()<<"onDataUpdate";
    curve->attach(this->ui->qwtPlot);
    ui->qwtPlot->replot();
}

void MainWindow::on_pushButton_clicked()
{
    PlotViewControl *p = PlotViewControl::GetInstance();
    p->Send();
}